#ifndef _NBIOT_H_
#define _NBIOT_H_


typedef enum{
	NB_OK          = 0,
	NB_TIMEOUT     = 1,
	NB_ERROR       = 2,
	NB_DATA_IN     = 3,
	NB_NET_CLOSED  = 4,
	NB_REG_CHANGED = 5,
	NB_REG_OK      = 6,
	NB_REG_ING     = 7
}NB_STA;


typedef struct nb_net_ctx{
	
	NB_STA (*iNetworkAttach_auto)(void);
	
	NB_STA (*iNetworkAttach_manual)(void);

	NB_STA (*iNetworkCheck)(void);

	NB_STA (*iDomainNameResolve)(char *, char *);

}NB_NET_CTX;

typedef struct nb_tcp_ctx{

	NB_NET_CTX net_ctx;
	
	int (*tcp_create)(int);

	NB_STA (*tcp_wait)(int *, int);

	NB_STA (*tcp_conn)(int, char *, int);
	
	NB_STA (*tcp_send)(int, unsigned char *, int, int);

	NB_STA (*tcp_recv)(int, int *, unsigned char *, int, int);

	NB_STA (*tcp_close)(int);

}NB_TCP_CTX;


int nbiot_net_ctx_init(NB_NET_CTX *ctx);
int nbiot_tcp_ctx_init(NB_TCP_CTX *ctx);

#endif

